Set Frequency and Duty Cycle of PWM Output Port
Function:
magician.set_pwm(io, freq, cycle)Description: set frequency and duty cycle of PWM output port
Required parameter:
- io: io port number, data type: str, range: "DO_01"~"DO_20"
- freq: PWM frequency, scope: 10Hz~1MHz
- cycle: duty cycle, scope: 0~100
- Return:
- True: The command has been finished.
- False: The command has not been finished.
Example
magician.set_pwm(io="DO_01", freq=10, cycle=30)Set PWM frequency of DO_01 port as 10Hz, and duty cycle as 30%.